package com.dmx.fw.bean.mapping.pojo;

import java.util.*;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.hibernate.annotations.CollectionOfElements;


/**
 * Resc entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name="SYSTEM_RESC")
public class Resc implements java.io.Serializable {

	// Fields

	@Id
	@GeneratedValue(strategy=GenerationType.AUTO,generator="resc_seq_gen")
	@SequenceGenerator(name = "resc_seq_gen", sequenceName = "SEQ_RESC")
	@Column(name = "ID", precision = 12, scale = 0)
	private Long id;
	
	@Column(name="NAME",length=60)
	private String name;
	
	@Column(name="RES_TYPE",length=60)
	private String resType;
	
	@Column(name="RES_STRING",length=60)
	private String resString;
	
	@Column(name="STATUS")
	private String status;
	
	@Column(name="IS_MENU")
	private Integer menuJust;
	
	@Column(name="IS_SHORTCUT")
	private Integer shortcutJust;
	
	@Column(name="PAR_FUNC_ID")
	private Long parFuncId;
	
	@Column(name="NORMAL_ICON",length=300)
	private String normalIcon;
	
	@Column(name="DIS_ICON_NAME",length=300)
	private String disIconName;
	
	@Column(name="MOUSEOVER_ICON_NAME",length=300)
	private String mouseoverIconName;
	
	@Column(name="ACTIVE")
	private Integer active;
	
	@Column(name="CHECKED")
	private Integer checked;
	
	@Column(name="SHORTCUT_SORT",precision=3,scale=0)
	private Long shortcutSort;
	
	@Column(name="MENU_SORT",precision=3,scale=0)
	private Long menuSort;
	
	@Temporal(TemporalType.DATE)
	@Column(name = "CREATED_TIME")
	private Date createdTime;
	
	@Temporal(TemporalType.DATE)
	@Column(name = "LAST_UPDATED_TIME")
	private Date lastUpdatedTime;
	
	@Column(name="VERSION",precision=10,scale=0)
	private Long version;

	@ManyToMany(fetch=FetchType.LAZY)
	@CollectionOfElements
	@JoinTable(name = "SYSTEM_RESC_ROLE", joinColumns = @JoinColumn(name = "RESC_ID"), 
			inverseJoinColumns = @JoinColumn(name = "ROLE_ID"))
	private Set<Role> roles = new HashSet<Role>(0);

	// Constructors

	/** default constructor */
	public Resc() {
	}

	/** full constructor */
	public Resc(String name, String resType, String resString, String status,
			Integer menuJust, Integer shortcutJust, Long parFuncId,
			String normalIcon, String disIconName, String mouseoverIconName,
			Integer active, Integer checked, Long shortcutSort, Long menuSort,
			Date createdTime, Date lastUpdatedTime, Long version) {
		this.name = name;
		this.resType = resType;
		this.resString = resString;
		this.status = status;
		this.menuJust = menuJust;
		this.shortcutJust = shortcutJust;
		this.parFuncId = parFuncId;
		this.normalIcon = normalIcon;
		this.disIconName = disIconName;
		this.mouseoverIconName = mouseoverIconName;
		this.active = active;
		this.checked = checked;
		this.shortcutSort = shortcutSort;
		this.menuSort = menuSort;
		this.createdTime = createdTime;
		this.lastUpdatedTime = lastUpdatedTime;
		this.version = version;
	}

	// Property accessors

	public Long getId() {
		return this.id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getResType() {
		return this.resType;
	}

	public void setResType(String resType) {
		this.resType = resType;
	}

	public String getResString() {
		return this.resString;
	}

	public void setResString(String resString) {
		this.resString = resString;
	}

	public String getStatus() {
		return this.status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	public Integer getMenuJust() {
		return this.menuJust;
	}

	public void setMenuJust(Integer menuJust) {
		this.menuJust = menuJust;
	}

	public Integer getShortcutJust() {
		return this.shortcutJust;
	}

	public void setShortcutJust(Integer shortcutJust) {
		this.shortcutJust = shortcutJust;
	}

	public Long getParFuncId() {
		return this.parFuncId;
	}

	public void setParFuncId(Long parFuncId) {
		this.parFuncId = parFuncId;
	}

	public String getNormalIcon() {
		return this.normalIcon;
	}

	public void setNormalIcon(String normalIcon) {
		this.normalIcon = normalIcon;
	}

	public String getDisIconName() {
		return this.disIconName;
	}

	public void setDisIconName(String disIconName) {
		this.disIconName = disIconName;
	}

	public String getMouseoverIconName() {
		return this.mouseoverIconName;
	}

	public void setMouseoverIconName(String mouseoverIconName) {
		this.mouseoverIconName = mouseoverIconName;
	}

	public Integer getActive() {
		return this.active;
	}

	public void setActive(Integer active) {
		this.active = active;
	}

	public Integer getChecked() {
		return this.checked;
	}

	public void setChecked(Integer checked) {
		this.checked = checked;
	}

	public Long getShortcutSort() {
		return this.shortcutSort;
	}

	public void setShortcutSort(Long shortcutSort) {
		this.shortcutSort = shortcutSort;
	}

	public Long getMenuSort() {
		return this.menuSort;
	}

	public void setMenuSort(Long menuSort) {
		this.menuSort = menuSort;
	}

	public Date getCreatedTime() {
		return this.createdTime;
	}

	public void setCreatedTime(Date createdTime) {
		this.createdTime = createdTime;
	}

	public Date getLastUpdatedTime() {
		return this.lastUpdatedTime;
	}

	public void setLastUpdatedTime(Date lastUpdatedTime) {
		this.lastUpdatedTime = lastUpdatedTime;
	}

	public Long getVersion() {
		return this.version;
	}

	public Set getRoles() {
		return roles;
	}

	public void setRoles(Set roles) {
		this.roles = roles;
	}

	public void setVersion(Long version) {
		this.version = version;
	}

}